package com.isias.system.service.Impl;

import com.isias.model.dto.VideoDto;
import com.isias.model.vo.SelectVideoVo;
import com.isias.model.vo.Star;
import com.isias.model.vo.VideoVo;
import com.isias.system.mapper.VideoMapper;
import com.isias.system.service.VideoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional(rollbackFor = Exception.class)
public class VideoServiceImpl implements VideoService {

    @Autowired
    private VideoMapper videoMapper;


    @Override
    public List<VideoDto> SelectAll(SelectVideoVo videoVo) {
        return videoMapper.SelectAll(videoVo);
    }

    @Override
    public VideoDto SelectOne(String id) {
        return videoMapper.SelectOne(id);
    }

    @Override
    public Boolean UpdataOneById(VideoVo videoVo) {
        return videoMapper.UpdataOneById(videoVo) == 1;
    }

    @Override
    public Boolean RemoveOneById(String id) {
        return videoMapper.RemoveOneById(id) == 1;
    }

    @Override
    public Boolean Add(VideoVo videoVo) {
        return videoMapper.Add(videoVo) == 1;
    }


    @Override
    public Boolean UpdateUrlById(String url, String id) {
        return videoMapper.UpdateUrlById(url, id) > 0;
    }


}
